/**
 * ...
 * @author Tony Polinelli
 */

package hxphp.oo.gd;


class GDFontResource { }

class GDPostscriptFont 
{
	public var fontResource:GDFontResource;
	
	public function new(filename:String) 
	{
		this.fontResource = untyped __call__("imagepsloadfont", filename );
	}
	
	
	/** Load a PostScript Type 1 font from file  */
	public static inline function imagePSLoadFont ( filename:String ):GDPostscriptFont
	{
		return new GDPostscriptFont(filename);
	}
	
	/***************************************************************/
	
	
	
	
	/** Free memory used by a PostScript Type 1 font   */
	public function freeFont ():Bool
	{
		return untyped __call__("imagepsfreefont", fontResource );
	}
	
	/** Free memory used by a PostScript Type 1 font  */
	public function destroy ():Void
	{
		freeFont();
	}
	
	/** Slant a font */
	public function slantFont ( slant:Float ):Bool
	{
		return untyped __call__("imagepsslantfont", fontResource, slant );
	}
	
	/** Give the bounding box of a text rectangle using PostScript Type1 fonts  */
	public function bBox ( text:String, size:Int, ?space:Int, ?tightness:Int, angle:Float ):Array<Dynamic>
	{
		return untyped __call__("imagepsbbox", text, fontResource, size, space, tightness, angle);
	}
	
	/** Change the character encoding vector of a font  */
	public function encodeFont( encodingfile:String ):Bool
	{
		return untyped __call__("imagepsencodefont", fontResource, encodingfile );
	}
	
	/** Extend or condense a font  */
	public function extendFont( extend:Float ):Bool
	{
		return untyped __call__("imagepsextendfont", fontResource, extend );
	}
	
}